﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="modify.aspx.cs" Inherits="modify" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>修改信息</title>
    <style>
        .wellcome{
            width:103%;
            height:80px;
            font-style:italic;
            text-align:center;
            margin:-10px -5px;
            border:2px solid transparent;
            background-color:rgba(0, 255, 255, 0.54);
        }
        a{
            text-decoration:none;
            text-align:center
        }
        .main{
            width:600px;
            margin:20px auto;
           /* border:1px solid red;*/
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="wellcome"> 
            <h1>学生选课系统</h1>
        </div>
        <div class="main">
            <asp:LinkButton ID="LinkButton4" runat="server" BackColor="#CCCCCC" BorderColor="Silver" BorderStyle="Outset" Font-Size="Larger" Width="90px" PostBackUrl="~/Main.aspx">首页</asp:LinkButton>
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="LinkButton1" runat="server" BackColor="#CCCCCC" BorderColor="Silver" BorderStyle="Outset" Font-Size="Larger" OnClick="LinkButton1_Click">修改学生信息</asp:LinkButton>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="LinkButton2" runat="server" BackColor="#CCCCCC" BorderColor="Silver" BorderStyle="Outset" Font-Size="Larger" OnClick="LinkButton2_Click">修改老师信息</asp:LinkButton>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:LinkButton ID="LinkButton3" runat="server" BackColor="#CCCCCC" BorderColor="Silver" BorderStyle="Outset" Font-Size="Larger" OnClick="LinkButton3_Click">修改课程信息</asp:LinkButton>
            <br />
            <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Label ID="Label1" runat="server" Text="学号/职工号/课程号:"></asp:Label>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
&nbsp;<asp:Button ID="Button1" runat="server" Text="修改" OnClick="Button1_Click" />
            <br />
            <br />
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="sno" DataSourceID="SqlDataSource1" HorizontalAlign="Center" PageSize="5">
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True">
                    <ControlStyle Width="50px" />
                    </asp:CommandField>
                    <asp:BoundField DataField="sno" HeaderText="学号" ReadOnly="True" SortExpression="sno" />
                    <asp:BoundField DataField="sname" HeaderText="姓名" SortExpression="sname" />
                    <asp:BoundField DataField="ssex" HeaderText="性别" SortExpression="ssex" />
                    <asp:BoundField DataField="sclass" HeaderText="班级" SortExpression="sclass" />
                </Columns>
                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                <RowStyle BackColor="White" ForeColor="#003399" />
                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SortedAscendingCellStyle BackColor="#EDF6F6" />
                <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
                <SortedDescendingCellStyle BackColor="#D6DFDF" />
                <SortedDescendingHeaderStyle BackColor="#002876" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Web_ExperimentConnectionString %>" DeleteCommand="delete from student where sno=@sno" InsertCommand="insert into student values(@sno,@sname,@ssex,@sclass)" SelectCommand="SELECT * FROM [student]" UpdateCommand="update student set sno=@sno,sname=@sname,ssex=@ssex,sclass=@sclass  where sno=@sno" ProviderName="<%$ ConnectionStrings:Web_ExperimentConnectionString.ProviderName %>"></asp:SqlDataSource>
            <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="tno" DataSourceID="SqlDataSource2" HorizontalAlign="Center" PageSize="5">
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True">
                    <ControlStyle Width="50px" />
                    </asp:CommandField>
                    <asp:BoundField DataField="tno" HeaderText="职工号" ReadOnly="True" SortExpression="tno">
                    <ControlStyle Width="50px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="tname" HeaderText="姓名" SortExpression="tname" />
                    <asp:BoundField DataField="tsex" HeaderText="性别" SortExpression="tsex" />
                    <asp:BoundField DataField="tphone" HeaderText="电话" SortExpression="tphone" />
                </Columns>
                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                <RowStyle BackColor="White" ForeColor="#003399" />
                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SortedAscendingCellStyle BackColor="#EDF6F6" />
                <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
                <SortedDescendingCellStyle BackColor="#D6DFDF" />
                <SortedDescendingHeaderStyle BackColor="#002876" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Web_ExperimentConnectionString %>" DeleteCommand="delete from teacher where tno=@tno" SelectCommand="SELECT * FROM [teacher]" UpdateCommand="update teacher set tno=@tno,tname=@tname,tsex=@tsex,tphone=@tphone  where tno=@tno"></asp:SqlDataSource>
            <asp:GridView ID="GridView3" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataKeyNames="cno" DataSourceID="SqlDataSource3" HorizontalAlign="Center" PageSize="5">
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True">
                    <ControlStyle Width="50px" />
                    </asp:CommandField>
                    <asp:BoundField DataField="cno" HeaderText="课程号" ReadOnly="True" SortExpression="cno">
                    </asp:BoundField>
                    <asp:BoundField DataField="cname" HeaderText="课程号名" SortExpression="cname" />
                    <asp:BoundField DataField="time" HeaderText="上课时间" SortExpression="time" />
                    <asp:BoundField DataField="place" HeaderText="上课地点" SortExpression="place" />
                    <asp:BoundField DataField="credit" HeaderText="学分" SortExpression="credit" />
                </Columns>
                <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
                <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
                <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
                <RowStyle BackColor="White" ForeColor="#003399" />
                <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
                <SortedAscendingCellStyle BackColor="#EDF6F6" />
                <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
                <SortedDescendingCellStyle BackColor="#D6DFDF" />
                <SortedDescendingHeaderStyle BackColor="#002876" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:Web_ExperimentConnectionString %>" DeleteCommand="delete from course where cno=@cno" SelectCommand="SELECT * FROM [course]" UpdateCommand="update course set cno=@cno,cname=@cname,time=@time,credit=@credit  where cno=@cno"></asp:SqlDataSource>
        </div>
    </form>
</body>
</html>
